package be.phl.obstacleapp;

import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.net.Uri;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;

public class Splash extends Activity implements OnCompletionListener {
	// private MediaController mc;
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splash);
		VideoView video = (VideoView) findViewById(R.id.videoView);
		Uri uri = Uri.parse("android.resource://" + getPackageName() + "/"
				+ R.raw.intro);
		// mc = new MediaController(this);

		// video.setMediaController(mc);
		video.requestFocus();
		video.setVideoURI(uri);
		video.start();
		video.setOnCompletionListener(this);
	}

	@Override
	public void onCompletion(MediaPlayer mp) {
		Intent intent = new Intent(this, LoginActivity.class);
		startActivity(intent);
		finish();
	}
}